package com.javalearn.gulimail.auth.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 在视图映射中添加视图跳转逻辑
 */
@Configuration
public class GulimailWebConfig implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        /**
         * 下面是以前controller中用来跳转页面的空路径
         *     @GetMapping("/login.html")
         *     public String loginPage(){
         *         return "login";
         *     }
         *
         *     @GetMapping("/reg.html")
         *     public String regPage(){
         *         return "reg";
         *     }
         */
//        registry.addViewController("/login.html").setViewName("login");
        registry.addViewController("/reg.html").setViewName("reg");
    }
}
